package com.sample.tdf.api;


import cn.com.taiji.common.api.BaseController;
import cn.com.taiji.common.dto.ResultDTO;
import com.sample.tdf.dto.EmployeeDTO;
import com.sample.tdf.service.IEmployeeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = {"401.员工操作接口"})
@RequestMapping("/homework/employee")
public class EmployeeController extends BaseController<IEmployeeService, EmployeeDTO> {

    @ApiOperation(value = "根据departmentName查询")
    @GetMapping(value = "/findByEmployeeDepartmentName")
    public ResultDTO findByEmployeeDepartmentName(@RequestParam String departmentName) {
        log.debug("into findByEmployeeDepartmentName");
        List<EmployeeDTO> data = iBaseService.findByDepartmentName(departmentName);
        return new ResultDTO(data);
    }

}
